using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class CapsuleColliderData
{
   public CapsuleCollider Collider { get; private set; }
   public Vector3 ColliderCenterInLocalSpace { get; private set; }
   public Vector3 ColliderVerticalExtents { get; private set; }
   
   public void Initialize(GameObject gameObj)
   {
      if (Collider != null)
         return;

      Collider = gameObj.GetComponent<CapsuleCollider>();
      
      UpdateColliderData();
   }

   public void UpdateColliderData()
   {
      ColliderCenterInLocalSpace = Collider.center;
      ColliderVerticalExtents = new Vector3(0, Collider.bounds.extents.y, 0);
   }
}
